package com.wish233.wiliwiliapi.fallback;

import com.wish233.wiliwiliapi.client.VideoClient;
import com.wish233.wiliwiliapi.domain.vo.VideoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.Collections;
import java.util.List;

/**
 * @author WHH
 * 视频服务降级处理
 */
@Slf4j
public class VideoClientFallback implements FallbackFactory<VideoClient> {
    @Override
    public VideoClient create(Throwable cause) {
        return new VideoClient() {
            @Override
            public List<VideoVO> getAllVideo() {
                return Collections.emptyList();
            }
        };
    }
}